package com.cxx.controller;

import com.cxx.log.Log;
import com.cxx.pojo.Result;
import com.cxx.utils.JwtUtils;
import io.jsonwebtoken.Claims;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestController {
    private JwtUtils jwtUtils=new JwtUtils();
    @GetMapping("/person-web/api/type")
    @Log
    public Result type(String token){
       Claims claims=jwtUtils.parseJwt(token);
       String type= (String) claims.get("type");
       return Result.success(type);
    }
    @GetMapping("/person-web/api/test")
    @Log
    public Result test(){
        return Result.success("OK");
    }
}
